package com.application.attachment.struts.form;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

import java.util.List;

import com.manager.commons.StringUtil;
import com.application.attachment.entity.Attachment;
import java.util.Date;


public class AttachmentForm extends ActionForm {

	/** serialVersionUID */
	protected static final long serialVersionUID = -1L;

	public AttachmentForm() {

	}

	private Long id;

	private String fid;

	private String type;

	private String filename;

	private Date inputtime;

	private String url;

	private String bak1;

	private String bak2;

	private String bak3;

	private String ids;

	private String inputtimeStr;
    
	private FormFile formFile;
	
	private String isShowAdd;
    
	private String bussName;
	
	private String operateid; 
	
	private String except;
	
	private String include;
	
	public String getInclude() {
		return include;
	}

	public void setInclude(String include) {
		this.include = include;
	}

	public String getExcept() {
		return except;
	}

	public void setExcept(String except) {
		this.except = except;
	}

	public String getOperateid() {
		return operateid;
	}

	public void setOperateid(String operateid) {
		this.operateid = operateid;
	}

	public String getIsShowAdd() {
		return isShowAdd;
	}

	public void setIsShowAdd(String isShowAdd) {
		this.isShowAdd = isShowAdd;
	}

	public FormFile getFormFile() {
		return formFile;
	}

	public void setFormFile(FormFile formFile) {
		this.formFile = formFile;
	}

	/**
	 * @return Returns the Inputtime.
	 */
	public String getInputtimeStr() {
		String re = "";
		if(this.inputtime == null) {
			return re;
		}
		try {
			re = StringUtil.dateToString(this.inputtime);
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		return re;
	}

	/**
	 * @param ${field.propertyName}
	 *        Set the ${field.propertyName}.
	 */
	public void setInputtimeStr(String inputtimeStr) {
		this.inputtimeStr = inputtimeStr;
		if(this.inputtimeStr != null && !"".equals(this.inputtimeStr)) {
			try {
				this.inputtime = StringUtil.stringToDate(this.inputtimeStr);
			}
			catch(Exception e) {
				e.printStackTrace();
			}
		}

	}

	/**
	 * @return Returns the Id
	 */
	public Long getId() {
		return this.id;
	}

	/**
	 * @param id
	 *        Set the id.
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return Returns the Fid
	 */
	public String getFid() {
		return this.fid;
	}

	/**
	 * @param fid
	 *        Set the fid.
	 */
	public void setFid(String fid) {
		this.fid = fid;
	}

	/**
	 * @return Returns the Type
	 */
	public String getType() {
		return this.type;
	}

	/**
	 * @param type
	 *        Set the type.
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return Returns the Filename
	 */
	public String getFilename() {
		return this.filename;
	}

	/**
	 * @param filename
	 *        Set the filename.
	 */
	public void setFilename(String filename) {
		this.filename = filename;
	}

	/**
	 * @return Returns the Inputtime
	 */
	public Date getInputtime() {
		return this.inputtime;
	}

	/**
	 * @param inputtime
	 *        Set the inputtime.
	 */
	public void setInputtime(Date inputtime) {
		this.inputtime = inputtime;
	}

	/**
	 * @return Returns the Url
	 */
	public String getUrl() {
		return this.url;
	}

	/**
	 * @param url
	 *        Set the url.
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @return Returns the Bak1
	 */
	public String getBak1() {
		return this.bak1;
	}

	/**
	 * @param bak1
	 *        Set the bak1.
	 */
	public void setBak1(String bak1) {
		this.bak1 = bak1;
	}

	/**
	 * @return Returns the Bak2
	 */
	public String getBak2() {
		return this.bak2;
	}

	/**
	 * @param bak2
	 *        Set the bak2.
	 */
	public void setBak2(String bak2) {
		this.bak2 = bak2;
	}

	/**
	 * @return Returns the Bak3
	 */
	public String getBak3() {
		return this.bak3;
	}

	/**
	 * @param bak3
	 *        Set the bak3.
	 */
	public void setBak3(String bak3) {
		this.bak3 = bak3;
	}

	private List<Attachment> attachmentList;

	/**
	 * @return the attachmentformList
	 */
	public List<Attachment> getAttachmentList() {
		return attachmentList;
	}

	/**
	 * @param attachmentList
	 *        the attachmentformList to set
	 */
	public void setAttachmentList(List<Attachment> attachmentList) {
		this.attachmentList = attachmentList;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	/**
	 * Method validate
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}

	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public String getBussName() {
		return bussName;
	}

	public void setBussName(String bussName) {
		this.bussName = bussName;
	}
}
